package com.karaoke.oksrv.domain

import java.util.*

/**
 * Created by Allen on 16/7/7.
 */
class QSinger
{
    var typeId: Int = 0
    var page: Int = 0
    var size: Int = 0
    var searchText: String = ""
    var direction: Direction? = null
    var sort: Array<String> = arrayOf()

    override fun hashCode(): Int
    {
        var result = typeId
        result = 31 * result + page
        result = 31 * result + size
        result = 31 * result + searchText.hashCode()
        result = 31 * result + (direction?.hashCode() ?: 0)
        result = 31 * result + Arrays.hashCode(sort)
        return result
    }

    override fun equals(other: Any?): Boolean{
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as QSinger

        if (typeId != other.typeId) return false
        if (page != other.page) return false
        if (size != other.size) return false
        if (searchText != other.searchText) return false
        if (direction != other.direction) return false
        if (!Arrays.equals(sort, other.sort)) return false

        return true
    }
}